ZonesClone
克隆表结构
请求地址
POST
http://OmsAddress/app/newoms.php/webservice/business/zones/clone?cmd=10006&ip-type=webservicerest&access-token=AccessTokenVal
POST请求参数说明
参数名称 | 数据类型 | 说明 | 是否必填字段 | 备注 |
---|---|---|---|---|
src_app_id | 整型 | 克隆源table所在的业务的app_id | 是 | |
src_zone_id | 整型 | 克隆源table所在的zone的zone_id | 是 | |
table_info | 数组 | 克隆源table的信息,支持克隆多个表,表信息结构如下:table_name:源table的table_name,字符串,必填 | 是 | |
dest_app_id | 整型 | 克隆表目标游戏区所在的业务的app_id | 是 | |
dest_zone_id | 整型 | 克隆表目标游戏区所在的zone的zone_id | 是 |
Data参数
使用json格式表示记录相关信息,示例如下:
{
"src_app_id": 2,
"src_zone_id": 3,
"table_info": [
{
"table_name": "tb_online_list"
}
],
"dest_app_id": 2,
"dest_zone_id": 4
}
返回语法
返回参数说明
返回状态码不为200时,表示添加zone失败,返回数据为错误信息
返回状态码为200,表示事务成功,其中表示修改删除成功的zone的信息、failed表示删除失败的zone的信息
请求示例
通过 curl 方法发起请求
命令中的参数请参考本页中的“POST请求参数说明”,access-token的获取方法详见:获取access-token
curl -H "Content-type: application/json" -X "POST" -d '{
"src_app_id": 2,
"src_zone_id": 3,
"table_info": [
{
"table_name": "tb_online_list"
}
],
"dest_app_id": 2,
"dest_zone_id": 4
}' http://omsaddress/app/newoms.php/webservice/business/zones/clone?cmd=10006&ip-type=webservicerest&access-token=<access-token>
返回示例
成功返回示例
http请求的Status=200,其中返回信息只需要拿到info信息中的id (单据id)并检查app_id、zone_list、table_name是否对上即可,其他字段无需关注。都是和克隆源一样的。
[
{
"id": 215,
"kelly_id": 0,
"set_id": 1,
"app_id": 2,
"app_name": "app_2",
"zone_list": "4",
"user": "tcaplus",
"job_id": "",
"table_name": "tb_online_list",
"table_type": 1,
"table_maxnum": 234,
"estimated_volume": 0,
"estimated_avarage_record_size": 0,
"estimated_write_load": 1,
"estimated_read_load": 1,
"type": "proto",
"key_struct": "",
"value_struct": "",
"write_time": "2021-02-08 17:55:15",
"memo": "Clone table from app(2) zone(3)",
"attention_man": "",
"dm_ratio": 0,
"execute_user": "",
"execute_status": 0,
"audit_memo": "",
"task_id": "",
"cu_list": "",
"machine_choose": "",
"version": "",
"hash_mode": 0,
"tdr": "21,20",
"apply_type": 0,
"engine_parameters": "bnum=1900000#xmsiz=250000000#xikmsiz=141000000#kmapow=6#kfapow=6#vmapow=6#vfapow=6#lnum=2",
"key_avarage_record_size": 1,
"value_avarage_record_size": 1,
"compress": 1,
"active_record_num": "1",
"total_record_num": "1",
"trans_id": "",
"calc_resource_type": 1,
"pcu": 0,
"relationship_chain_interval": 0,
"relationship_chain_count": 0,
"index_count": 0,
"read_index_interval": 0,
"read_index_count": 0,
"read_interval": 0,
"write_interval": 0,
"max_read_rate": 0,
"max_write_rate": 0,
"exceed_times": 0,
"idl_md5": null,
"resource_ratio": 1,
"ext_idl_md5": null,
"ext_zone_id": null,
"ext_info": null,
"moa_push_status": 0,
"moa_process_id": "",
"sort_field_num": 0,
"sort_rule": 0,
"data_protocol_type": "TBD"
}
]
错误返回
http请求的Status!=200
[
"can not find src table list:app:2,zone:3,table name list:tb_online_list_1"
]